Selectively cleaning git history
This way we clean any unwanted commits from the git history.
Requires: Java, bfg-repo-cleaner
First create a local copy of the repo folder (as backup just in case)
Clone a mirror of the git repo to a new location.
git clone --mirror git@github.com:gqc/IoT_Arduino_to_ESP-IDF.gitClean up the repo as desired.
In my case, I wanted to clean a build directory that was uploaded in an earlier commit.
Check this for more usage commands.java -jar bfg-1.14.0.jar --delete-folders build IoT_Arduino_to_ESP-IDF.gitGo into the repo directory and commit the changes
cd IoT_Arduino_to_ESP-IDF.git
git reflog expire --expire=now --all && git gc --prune=now --aggressivePush the changes to github
git pushDelete the mirror and the old repo you had. Clone a fresh copy of the repo from github. Make sure to compare with the backup you created in the step 1 and that haven't missed any important files in the cleaning step.